package org.lemon.transport.context.ota;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Component
public class OtaPackageDataCache {

    public static final String OTA_PACKAGE_DATA_CACHE = "otaPackagesData";

    public byte[] get(String key) {

        return null;
    }

    public byte[] get(String key, int chunkSize, int chunk) {

        return null;
    }


    public void evict(String key) {

    }

    private boolean has(String otaPackageId) {
        byte[] data = get(otaPackageId, 1, 0);
        return data != null && data.length > 0;
    }

    private byte[] toOtaPackageCacheKey(String key) {
        return String.format("%s::%s", OTA_PACKAGE_DATA_CACHE, key).getBytes();
    }
}
